package com.kotlin.demo

/**
 * 如果调用成功 返回的是 调用者本身
 */
fun main() {
    println(checkPermissionAction("Root", "453"))
}

private fun checkPermissionAction(userName: String, password: String): String {
    return userName.takeIf { permissionSystem(userName, password) } ?: "你的权限不够"
}

private fun permissionSystem(userName: String, password: String): Boolean {
    return userName == "Root" && password == "453"
}
